A workflow is a business flow formed by interconnecting related business activities according to a time sequence or a logical relationship. During business operation, documents, information, or tasks are transferred, processed, or executed between multiple participants according to specifications of an organization. A most notable characteristic of a workflow technology is automation of a part or all of a business process in a computer application environment, where such processes generally refer to activities involving both human and machine participation, for example, interaction processes with information technology (IT) application programs and tools. A workflow includes a group of tasks (or activities) and a sequence relationship between the tasks (or activities), and further includes start conditions and end conditions of a flow and a task, and a description of each task.
A workflow management system refers to a system that defines, creates, and executes workflows. The system provides function support mainly in the following three aspects: a construction function, which defines and models workflow processes and activities thereof, an operation control function, which manages workflow processes in an operation environment and schedules activities in a workflow process, and an operation interaction function, which interacts with users (participants or controllers of business jobs) and external application programs during operation of workflows.
At present, the workflow technology is widely applied. For example, workflows are introduced to businesses of an enterprise for business flow management. A middleware suite related to business flow management (Business Process Management (BPM)) generally includes a modeling tool (responsible for business flow modeling), a BPM engine (responsible for business flow driving), a flow management console, and a technical framework platform. The middleware suite can be embedded into a business system to provide an upper-layer business with application programming interfaces (API) for process modeling and engine process instance scheduling in order to help the business complete orchestration, deployment, operation, and scheduling of flows, thereby creating, for enterprises, various flows aligned with business development of the enterprises.
FIG. 1 illustrates a schematic diagram of a typical business flow orchestrated using BPM. From information synchronization to order fulfillment is a complete account opening flow, where each activity from information synchronization through pricing synchronization to order fulfillment is a task. A business service is configured for each task, and the services are executed in a sequence pre-orchestrated in FIG. 1. Each task corresponds to one node during scheduling and execution of the flow. The account opening flow itself is not a concern of the present embodiment of the application and therefore is not described in detail herein.
With respect to a business flow, customer requirements include:
Requirement 1. The flow is able to start to execute business services in accordance with a business goal under a precondition of correct logic configuration until the end.
Requirement 2. The flow is able to record execution information in each step for business tracking and query.
Requirement 3. Data consistency with business data changes needs to be kept during forward flow of the flow.
Requirement 4. When an exception occurs on a node in the flow, the flow stops at the exceptional node, and retry upon failure or human intervention is supported, until the flow can continue to be executed, without affecting business service scheduling that has been completed.
Requirement 5. When an engine process terminates exceptionally, it may be necessary to support that execution is resumed from an uncompleted task upon restart of the process.
Requirement 6. Scheduling performance of the flow should be high.
In a prior-art solution, a visual flow orchestration tool is first used to complete service configuration and sequence orchestration for a definition of a business flow, a BPM engine drives the flow forward until completion, based on the foregoing orchestrated flow definition according to business inputs and call requests. A flow of the BPM engine is persisted to a database, and a transaction mechanism is used for control in the persistence process to ensure data consistency. To ensure that transactions between a BPM platform and a business system are scheduled uniformly, a same transaction framework, for example, a Spring transaction framework or another similar transaction framework, needs to be used for the business system and the BPM platform. Declarative transactions also need to be configured for the business to initiate calls to APIs of the BPM platform. A declarative transaction means that the transaction is handled by means of a declaration in a configuration file. An advantage of using declarative transactions is that when transaction management changes, it may be necessary to make reconfiguration in the configuration file, without a need to change code for recompilation. As the business calls a flow start API to drive the flow to flow forward, because transaction control is used, if an exception occurs on an intermediate node, a transaction is rolled back to a transaction start point, but rollback to the exceptional node is not supported and execution cannot be resumed from the exceptional node either.
Therefore, during business flow scheduling, the prior art cannot both ensure data consistency between a business system and a BPM platform and ensure that a flow terminates at an exceptional node upon occurrence of an exception and that execution is resumed from the exceptional node later.